﻿using UnityEngine;
using System.Collections;
using UI;
using UnityEngine.UI;
using Base.Custom;
using Base.Data;
using Base.Extensions;
public class 空间分配 : BasePanel
{
    public override void OnEnter()
    {
        gameObject.SetActive(true);
    }
    // Use this for initialization
    void Start()
    {

    }
    public override void OnExit()
    {
        gameObject.SetActive(false);
    }
    
    // Update is called once per frame
    void Update()
    {

    }
    public void 点击事件(Text text)
    {
        SingleObject obj = Dictionaries.SingleObject.GetKeyValue<string, SingleObject>(text.text);
        Vector3 poin = obj.transform.position-FreeCamera.freecamera.transform.position;
        FreeCamera.freecamera.transform.position = new Vector3(poin.x-20,poin.y+20,poin.z-20);
        FreeCamera.freecamera.transform.LookAt(obj.transform);
    }
    public void 关闭界面()
    {
        UIManager.Instance.PopPanel();
    }
}
